import React from 'react';
import cn from 'classnames';
import s from './style.module.css';
import i from '@/common.module.css';
import EmptyData from '../EmptyData';
import { Checkbox } from '@knownsec/react-component';
export default function Table({ className,selectable, columns }) {
  return (
    <div className={cn(s.tableConatiner, className)}>
      <table className={s.table}>
        <thead>
          <tr className={s.head}>
            { selectable && (
              <td key='checkall' className={s.head} style={{ width: '50px' }}>
                <Checkbox onChange={()=>{}}/>
              </td>
            )}
            {columns.map(({ key, title, className }) => (
              <td key={key} className={className}>
                {title}
              </td>
            ))}
          </tr>
        </thead>
        <tbody className={cn(s.tbody, i.pr)}>
          <EmptyData size='small' text='当前版本不支持，请升级服务'></EmptyData>
        </tbody>
      </table>
    </div>
  );
}
